<%--
  Created by IntelliJ IDEA.
  User: 52203
  Date: 2018/12/27
  Time: 16:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <base href="<%=request.getContextPath()%>/"/>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <script src="static/js/jquery-2.1.1.min.js"></script>
    <%@include file="../layUI.jsp"%>
</head>
<body>
<form action="doUser?action=userUpdate" method="post" id="Myforms">
    ID<input type="text" value="${User.id}" name="id" readonly>
    姓名<input type="text" value="${User.userName}" name="userName">
    身份证号<input type="text" value="${User.userId}" name="userId">
    登录名<input type="text" value="${User.userLoginName}" name="userLoginName" readonly>
    <input type="button" value="修改完成" class="layui-btn" onclick="UpdateUser()">
</form>
<script>
    $(function () {
        var flag = '${param.flag}'
        if(flag=="false"){
            alert("修改失败！");
        }
    })
    //修改个人信息
    function UpdateUser() {
        var userId = $("[name=userId]").val();
        var userLoginName = $("[name=userLoginName]").val();
        var userName =$("[name=userName]").val();
        if(userId==null || userId==""){
            alert("身份证号不能为空！")
            return;
        }else if(userLoginName ==null || userLoginName==""){
            alert("登陆名不能为空！")
            return;
        }else if(userLoginName.length<3){
            alert("登陆名不能少于3位！")
            return;
        }else if(userName=="" ||userName==null ){
           alert("姓名不能为空！") ;
           return;
        }else{
            $("#Myforms").submit();
        }
    }
</script>
</body>
</html>
